package user_role

import (
	"cgs-server/server/base"
	"cgs-server/server/model"
	"go.mongodb.org/mongo-driver/bson/primitive"
)

type UserRoleService interface {
	base.Service
	FindByUserId(userId primitive.ObjectID) (*model.UserRoleList, error) // 根据 userId 获取
	FindByRoleId(roleId primitive.ObjectID) (*model.UserRoleList, error) // 根据 roleId 获取
}

func NewUserRoleService() UserRoleService {
	return &userRoleService{
		ServiceImpl: base.ServiceImpl{Repo: NewUserRoleRepository()},
	}
}

type userRoleService struct {
	base.ServiceImpl
}

func (ur *userRoleService) FindByUserId(userId primitive.ObjectID) (*model.UserRoleList, error) {
	//ur.Repo.
	return nil, nil
}

func (ur *userRoleService) FindByRoleId(roleId primitive.ObjectID) (*model.UserRoleList, error) {
	return nil, nil
}
